package edu.sctu.practice.class02.Wangpeng.Assign03.A0302;

/**
 * Created by wp on 2015/11/4.
 */
public class Cylinder extends Cricle {
    private  double length;

    public Cylinder(){
        super();
        length=1.0;
    }
    public Cylinder(double r,double l){
        super(r);
        length=1;
    }
    public double getLength(){
        return length;
    }
    public void setLength(double length){
        this.length=length;
    }
    public double findArea(){
        return 2*super.findArea()+(2*getRadius()*Math.PI)*length;
    }
    public double findVolume(){
        return super.findArea()*length;
    }
    public boolean equals(Cylinder cylinder){
        return (this.radius==cylinder.getRadius())&&(this.length==cylinder.getLength());
    }
    public String toString(){
        return "圆的半径="+radius+"圆柱的长="+length;
    }
}
